
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.2 架构 · 大数据 HA 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="23-bu-shu.html" />
    
    
    <link rel="prev" href="21-bei-jing.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    第 1 章 HA概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1.html">
            
                <a href="../chapter1.html">
            
                    
                    第 2 章 HDFS HA
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="21-bei-jing.html">
            
                <a href="21-bei-jing.html">
            
                    
                    2.1 背景
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="22-jia-gou.html">
            
                <a href="22-jia-gou.html">
            
                    
                    2.2 架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="23-bu-shu.html">
            
                <a href="23-bu-shu.html">
            
                    
                    2.3 HDFS HA 部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="24-ha-hdfs-ji-qun-guan-li-ming-ling.html">
            
                <a href="24-ha-hdfs-ji-qun-guan-li-ming-ling.html">
            
                    
                    2.4 HA HDFS 集群管理命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="24-zi-dong-bei-707e28-automatic-failover.html">
            
                <a href="24-zi-dong-bei-707e28-automatic-failover.html">
            
                    
                    2.5 自动备灾(Automatic Failover)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="26-wen-da.html">
            
                <a href="26-wen-da.html">
            
                    
                    2.6 自动备灾常见问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../di-3-zhang-yarn-resourcemange-ha.html">
            
                <a href="../di-3-zhang-yarn-resourcemange-ha.html">
            
                    
                    第 3 章 Yarn ResourceMange HA
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2.2 架构</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="22-&#x67B6;&#x6784;">2.2 &#x67B6;&#x6784;</h1>
<h2 id="&#x67B6;&#x6784;&#x6982;&#x8FF0;">&#x67B6;&#x6784;&#x6982;&#x8FF0;</h2>
<p>&#x5728;&#x4E00;&#x4E2A;&#x5178;&#x578B;&#x7684; HA &#x96C6;&#x7FA4;&#x4E2D;, &#x4F1A;&#x5728; 2 &#x4E2A;&#x72EC;&#x7ACB;&#x8BBE;&#x5907;&#x4E0A;&#x5206;&#x522B;&#x914D;&#x7F6E; 1 &#x4E2A; NameNode, &#x8FD9;&#x4E2A;&#x8FD9;&#x4E2A;&#x96C6;&#x7FA4;&#x4E2D;&#x5C31;&#x6709;&#x4E86; 2 &#x4E2A; NameNode.  &#x907F;&#x514D;&#x5355;&#x70B9;&#x5931;&#x6548;&#x7684;&#x7B2C;&#x4E00;&#x6B65;.</p>
<p>&#x5728;&#x4EFB;&#x4F55;&#x7684;&#x65F6;&#x95F4;&#x70B9;&#x4E0A;, &#x4E25;&#x683C;&#x7684;&#x6309;&#x7167;&#x5176;&#x4E2D;&#x4E00;&#x4E2A; NameNode &#x662F;&#x6D3B;&#x52A8;&#x72B6;&#x6001;(Active state), &#x53E6;&#x5916;&#x4E00;&#x4E2A; NameNode &#x662F;&#x5907;&#x7528;&#x72B6;&#x6001;(Standby state). &#x5728;&#x96C6;&#x7FA4;&#x4E2D;, &#x6D3B;&#x52A8;&#x7684; NameNode &#x8D1F;&#x8D23;&#x6240;&#x6709;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x64CD;&#x4F5C;, &#x800C;&#x5907;&#x7528; NameNode &#x4EC5;&#x4EC5;&#x662F;&#x7B80;&#x5355;&#x4F5C;&#x4E3A;&#x4E00;&#x4E2A;&#x5907;&#x4EFD;, &#x4E00;&#x65E6;&#x51FA;&#x73B0;&#x95EE;&#x9898;, &#x53EF;&#x4EE5;&#x8FDB;&#x884C;&#x4E00;&#x4E2A;&#x5FEB;&#x901F;&#x7684;&#x5207;&#x6362;.</p>
<hr>
<p>&#x4E3A;&#x4E86;&#x4F7F;&#x5907;&#x7528; NameNode &#x7684;&#x6570;&#x636E;&#x4E0E;&#x6D3B;&#x52A8; NameNode &#x7684;&#x6570;&#x636E;&#x540C;&#x6B65;, &#x8FD9;&#x4E24;&#x4E2A; NameNode &#x8282;&#x70B9;&#x901A;&#x8FC7;&#x4E00;&#x7EC4;&#x72EC;&#x7ACB;&#x7684;&#x79F0;&#x4F5C;<code>JournalNodes(JNs)</code>&#x5B88;&#x62A4;&#x8FDB;&#x7A0B;&#x8FDB;&#x884C;&#x901A;&#x8BAF;.<br>&#x5F53;&#x6D3B;&#x52A8; NameNode &#x4FEE;&#x6539;&#x4E86;&#x4EFB;&#x4F55;&#x6570;&#x636E;, &#x90FD;&#x4F1A;&#x628A;&#x4FEE;&#x6539;&#x8BB0;&#x5F55;&#x65E5;&#x5FD7;&#x63D0;&#x4EA4;&#x7ED9;<code>JNs</code>.  &#x5907;&#x4EFD; NameNode &#x5C31;&#x4F1A;&#x6536;&#x5230;&#x6765;&#x81EA;<code>JNs</code>&#x7684;<code>edits</code>, &#x4ED6;&#x5C31;&#x4F1A;&#x628A;&#x8FD9;&#x4E9B;&#x8FD9;&#x4E9B;&#x4FEE;&#x6539;&#x5199;&#x5230;&#x81EA;&#x5DF1;&#x7684;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x4E2D;.</p>
<p>&#x5728;&#x5907;&#x707E;&#x53D1;&#x751F;&#x7684;&#x65F6;&#x5019;, &#x5907;&#x4EFD; NameNode &#x4F1A;&#x786E;&#x4FDD;&#x81EA;&#x5DF1;&#x5DF2;&#x7ECF;&#x4ECE;<code>JNs</code>&#x8BFB;&#x5230;&#x4E86;&#x6240;&#x6709;&#x7684;<code>edits</code>, &#x7136;&#x540E;&#x628A;&#x81EA;&#x5DF1;&#x53D8;&#x6210;&#x6D3B;&#x52A8;&#x72B6;&#x6001;(Active state). &#x8FD9;&#x4E9B;&#x64CD;&#x4F5C;&#x53EF;&#x4EE5;&#x786E;&#x4FDD;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x7684;&#x72B6;&#x6001;&#x53EF;&#x4EE5;&#x5B8C;&#x5168;&#x4E0E;&#x5907;&#x707E;&#x53D1;&#x751F;&#x524D;&#x4FDD;&#x6301;&#x4E00;&#x81F4;.</p>
<p>&#x4E3A;&#x4E86;&#x5177;&#x6709;&#x5FEB;&#x901F;&#x5907;&#x707E;&#x7684;&#x80FD;&#x529B;, &#x5907;&#x4EFD; NameNode &#x4E5F;&#x5FC5;&#x987B;&#x6709;&#x96C6;&#x7FA4;&#x4E2D;&#x6240;&#x6709;&#x6570;&#x636E;&#x5757;&#x4F4D;&#x7F6E;&#x7684;&#x6700;&#x65B0;&#x4FE1;&#x606F;. &#x4E3A;&#x4E86;&#x5B9E;&#x73B0;&#x8FD9;&#x4E2A;&#x9700;&#x6C42;,  &#x6240;&#x6709;&#x7684;<code>DataNode</code>&#x4F1A;&#x88AB;&#x914D;&#x7F6E; 2 &#x4E2A; <code>NameNode</code> &#x7684;&#x4F4D;&#x7F6E;&#x4FE1;&#x606F;, &#x5E76;&#x4E14;&#x4F1A;&#x53D1;&#x9001;&#x6570;&#x636E;&#x5757;&#x7684;&#x4F4D;&#x7F6E;&#x4FE1;&#x606F;&#x548C;&#x5FC3;&#x8DF3;&#x7ED9; 2 <code>NameNode</code>.</p>
<hr>
<p>&#x5BF9;&#x6B63;&#x786E;&#x7684;&#x64CD;&#x4F5C; HA &#x96C6;&#x7FA4;&#x6765;&#x8BF4;, &#x540C;&#x4E00;&#x65F6;&#x95F4;&#x53EA;&#x80FD;&#x6709;&#x4E00;&#x4E2A;&#x6D3B;&#x52A8;&#x72B6;&#x6001;&#x7684; <code>NameNode</code>&#x662F;&#x81F3;&#x5173;&#x91CD;&#x8981;&#x7684;. &#x5426;&#x5219;&#x7684;&#x8BDD;, &#x4E24;&#x4E2A;<code>NameNode</code>&#x7684;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x4F1A;&#x8FC5;&#x901F;&#x7684;&#x53D8;&#x7684;&#x6709;&#x5DEE;&#x5F02;, &#x5BFC;&#x81F4;&#x6570;&#x636E;&#x4E22;&#x5931;&#x548C;&#x5176;&#x4ED6;&#x4E00;&#x4E9B;&#x9519;&#x8BEF;&#x7ED3;&#x679C;&#x7684;&#x98CE;&#x9669;.</p>
<p>&#x4E3A;&#x4E86;&#x786E;&#x4FDD;&#x6570;&#x636E;&#x4E0D;&#x4E22;&#x5931;&#x548C;&#x963B;&#x6B62;&#x6240;&#x8C13;&#x7684;&#x8111;&#x88C2;&#x60C5;&#x51B5;(split-brain scenario)&#x53D1;&#x751F;, JournalNodes(JNs) &#x751A;&#x81F3;&#x540C;&#x4E00;&#x65F6;&#x95F4;&#x53EA;&#x5141;&#x8BB8;&#x5355;&#x72EC;&#x4E00;&#x4E2A; NameNode &#x53EF;&#x4EE5;&#x88AB;&#x5199;&#x5165;&#x6570;&#x636E;.</p>
<p>&#x5728;&#x5907;&#x707E;&#x671F;&#x95F4;, &#x5373;&#x5C06;&#x53D8;&#x6210;&#x6D3B;&#x52A8;&#x72B6;&#x6001;&#x7684; NameNode &#x4F1A;&#x8D1F;&#x8D23;&#x5411; JournalNodes &#x5199;&#x6570;&#x636E;, &#x8FD9;&#x5C06;&#x6709;&#x6548;&#x7684;&#x963B;&#x6B62;&#x5176;&#x4ED6; NameNode &#x7EE7;&#x7EED;&#x5904;&#x4E8E;&#x6D3B;&#x52A8;&#x72B6;&#x6001;, &#x7136;&#x540E;&#x65B0;&#x7684;&#x6D3B;&#x52A8; NameNode &#x80FD;&#x591F;&#x5B89;&#x5168;&#x7684;&#x5904;&#x7406;&#x5907;&#x707E;.</p>
<blockquote>
<p>&#x8111;&#x88C2;: &#x5982;&#x679C;&#x540C;&#x65F6;&#x6709;&#x4E24;&#x4E2A;&#x6D3B;&#x52A8;&#x7684; NameNode, &#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x5C31;&#x53EB;&#x8111;&#x88C2;. </p>
</blockquote>
<hr>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; &amp; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-10-18 13:08:16
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="21-bei-jing.html" class="navigation navigation-prev " aria-label="Previous page: 2.1 背景">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="23-bu-shu.html" class="navigation navigation-next " aria-label="Next page: 2.3 HDFS HA 部署">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"2.2 架构","level":"1.2.2","depth":2,"next":{"title":"2.3 HDFS HA 部署","level":"1.2.3","depth":2,"path":"chapter1/23-bu-shu.md","ref":"chapter1/23-bu-shu.md","articles":[]},"previous":{"title":"2.1 背景","level":"1.2.1","depth":2,"path":"chapter1/21-bei-jing.md","ref":"chapter1/21-bei-jing.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 & 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://o7cqr8cfk.bkt.clouddn.com/18-3-4/62171757.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/83394736.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/15906185.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/15906185.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/3394270.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/65028582.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/20359261.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/37472401.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/3355397.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"https://www.gitbook.com/@zhenchao125"},"page-toc-button":{"maxTocDepth":6,"minTocSize":5},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 HA 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"chapter1/22-jia-gou.md","mtime":"2018-10-18T05:08:16.073Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-11T09:39:05.323Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

